<?php View::render('admin/layouts/meta');?>
<body>
<nav class="breadcrumb">
    <i class="Hui-iconfont">&#xe67f;</i> 首页
    <span class="c-gray en">&gt;</span> 商品管理
    <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" >
        <i class="Hui-iconfont">&#xe68f;</i>
    </a>
</nav>
<div class="page-container">
    <form>
        <div class="text-c">
            <input type="text" class="input-text" style="width:200px" placeholder="订单号" name="order_sn" value="<?php echo $order_sn; ?>">
            <input type="hidden" name="page" value="1"/>
            <button type="submit" class="btn btn-success radius" id="" name=""><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
        </div>
    </form>
    <div class="cl pd-5 bg-1 bk-gray mt-20">
        <span class="r">共有数据：<strong><?php echo $total; ?></strong> 条</span>
    </div>
    <div class="mt-20">
        <table class="table table-border table-bordered table-hover table-bg table-sort">
            <thead>
            <tr class="text-c">
                <th width="50">ID</th>
                <th width="150">订单号</th>
                <th width="150">商品</th>
                <th width="150">收货人</th>
                <th width="">地址</th>
                <th width="150">联系电话</th>
                <th width="50">积分</th>
                <th width="70">是否发货</th>
                <th width="120">下单时间</th>
                <th width="100">操作</th>
            </tr>
            </thead>
            <tbody>
            <?php if ($list) {
                foreach ($list as $info) {?>
                    <tr class="text-c">
                        <td><?php echo $info['orderId']; ?></td>
                        <td class="text-l"><?php echo $info['order_sn']; ?></td>
                        <td><?php echo $info['goods_name']; ?></td>
                        <td><?php echo $info['name']; ?></td>
                        <td><?php echo $info['address']; ?></td>
                        <td><?php echo $info['mobile']; ?></td>
                        <td><?php echo $info['integral']; ?></td>
                        <td><?php echo $info['status']==1?"是":"否"; ?></td>
                        <td><?php echo date("Y-m-d H:i",$info['add_time']); ?></td>
                        <td>
                            <a href="javascript:;" style="text-decoration:none"  class="j_fahuo ml-5" rel="<?php echo $info['orderId']; ?>">发货</a>
                        </td>
                    </tr>
                <?php }}?>
            </tbody>
        </table>
        <div>
            <?php echo $pageHtml; ?>
        </div>
    </div>
</div>
</body>
<?php View::render('admin/layouts/footer');?>
<script type="text/javascript">
    $(function(){
        window.formAlert = function(title, url, w, h) {
            layer.open({
                type: 2,
                title: title,
                area: [w, h],
                content: url,
                end: function(){
                    window.location.href=location.href;
                }
            });
        }
        $('.j_fahuo').click(function(){
            var id = $(this).attr('rel');
            var r=confirm("确定发货吗？")
            if (r==true)
            {
                $.post('<?php echo Router::getBaseUrl(); ?>/admin_order/fahuo', {orderId:id}, function (result) {
                    if (result.status == 200) {
                        layer.msg(result.msg, {
                            icon: 1,
                            skin: 'u-msg',
                            time: 1800,
                        },function() {
                            window.location.href = location.href;
                            return true;
                        });
                    }else{
                        layer.msg(result.msg, {
                            icon: 0,
                            skin: 'u-msg',
                            time: 2200,
                        });
                    }
                }, 'json');
            }

            return;
        });
    });
</script>
</html>